from typing import Optional
from pydantic import BaseModel

class FamilyBase(BaseModel):
    name: str
    description: Optional[str] = None
    avatar: Optional[str] = None
    order: int = 0
    parent_id: int = 0
    max_members: int = 20

class FamilyCreate(FamilyBase):
    pass

class FamilyUpdate(FamilyBase):
    id: int

class FamilyInDB(FamilyBase):
    id: int
    is_active: bool
    created_by_id: int
    is_deleted: bool = False

    class Config:
        from_attributes = True